using System;
using System.Collections.Generic;
using ProjectBase.Utils;
using Iesi.Collections.Generic;

namespace Clanta.Core.Domain
{
    /// <summary>
    /// Represents a conference organized by a specific customer.
    /// </summary>
    public class Conference : VersionDomainObject<long, long>
    {
        #region Constructors

        protected Conference()
        {
        }

        public Conference(string name, Customer customer)
        {
            Name = name;
            Customer = customer;
        }

        #endregion

        #region Properties

        /// <summary>
        /// The name of the conference.
        /// </summary>
        public virtual string Name
        {
            get { return name; }
            protected set
            {
                Check.Require(!string.IsNullOrEmpty(value), "The conference name must be provided");
                name = value;
            }
        }

        /// <summary>
        /// The customer responsible for this conference. Always non-null.
        /// </summary>
        public virtual Customer Customer
        {
            get { return customer; }
            protected set
            {
                Check.Require(value != null, "The customer must be provided");
                customer = value;
            }
        }

        /// <summary>
        /// The tracks for this conference. The list may be empty.
        /// </summary>
        public virtual IList<Track> Tracks
        {
            get { return tracks; }
            protected set
            {
                Check.Require(value != null, "The track list must be provided");
                tracks = value;
            }
        }

        /// <summary>
        /// The presentations for this conference. The list may be empty.
        /// </summary>
        public virtual IList<Presentation> Presentations
        {
            get { return presentations; }
            protected set
            {
                Check.Require(value != null, "The presentation list must be provided");
                presentations = value;
            }
        }

        /// <summary>
        /// The speakers associated with this conference.
        /// </summary>
        public virtual IList<Speaker> Speakers
        {
            get { return speakers; }
            protected set
            {
                Check.Require(value != null, "The speakers associated with this conference must not be null");
                speakers = value;
            }
        }
        #endregion

        #region Fields

        private string name;

        private Customer customer;

        private IList<Track> tracks = new List<Track>();

        private IList<Presentation> presentations = new List<Presentation>();

        private IList<Speaker> speakers = new List<Speaker>();

        #endregion
    }
}
